package day03_0623;

import java.util.Random;

public class Test6 {
    public static void main(String[] args) {
        Random r=new Random();

        int num=r.nextInt();
        //如果num随机数是无效的值(超范围)，就用while循环重新生成
        while(num<0  || num>300){
            num=r.nextInt();
        }
        System.out.println(num);
    }
}








